package edu.wtbu.cs.androiddemo.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import edu.wtbu.cs.androiddemo.R;

public class ButtonImageActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_button_image);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        //绑定事件
//        ImageButton imageButton = findViewById(R.id.head_icon);
//        imageButton.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                Toast.makeText(ButtonImageActivity.this,"您点击了登录图标222",Toast.LENGTH_LONG).show();
//            }
//        });
    }

    public void onClickImageButton(View view){
        Toast.makeText(ButtonImageActivity.this,"您点击了登录图标",Toast.LENGTH_SHORT).show();

    }
}